/*
    Copyright (c) 2011 Denis Mingulov.

    This file is part of Password Generator.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PASSGENWIDGET_H
#define PASSGENWIDGET_H

#include <QtCore/QScopedPointer>
#include <meegotouch/MStylableWidget>

#include "passgenwidgetstyle.h"

class MLabel;
class MContainer;

class PassGenWidget : public MStylableWidget
{
    Q_OBJECT
    M_STYLABLE_WIDGET(PassGenWidgetStyle);

public:
    PassGenWidget(QGraphicsItem *parent = 0);
    virtual ~PassGenWidget();
    virtual void createContent();

protected:
    //! \reimp
    virtual void exitDisplayEvent();
    virtual void enterDisplayEvent();

    virtual QGraphicsLayoutItem *createHeader() const;
    virtual MContainer *createEmptyContainer(const QString &containerStyle = QString(), bool headerVisible = true) const;
    virtual MContainer *createSettingsContainer();
    virtual QGraphicsLayoutItem *createSpacer(const QString &style = QString()) const;
    virtual QGraphicsLayoutItem *createOneSetting(const QString &title, const char *slotName, bool value = false, QGraphicsLayoutItem *additionalItem = 0);
    virtual QGraphicsLayoutItem *createLengthSlider();
    virtual MContainer *createPasswordContainer();

protected slots:
    virtual void modifiedLength(int value);
    virtual void clickedUppercase(bool value);
    virtual void clickedLowercase(bool value);
    virtual void clickedNumbers(bool value);
    virtual void clickedSpecial(bool value);
    virtual void specialStringChanged();
    virtual void generatePassword();
    virtual void copyPassword();
    virtual void updateContent();
    virtual void clickedClearHistory();
    virtual void clickedInfo();

private:
    //! Private data
    QScopedPointer<class PassGenWidgetPrivate> d_ptr;
};

#endif // PASSGENWIDGET_H
